<template>
	<view style="padding: 30rpx;" v-if="move_info">
		<!-- 上面 -->
		<view class="nav">
			<image :src="move_info.img"
				class="move_img"></image>
			<view class="move_info">
				<view class="name">{{move_info.movie_name}}</view>
				<view class="text">类型:{{move_info.type}}</view>
				<view class="text">演员:{{move_info.actor.length>0?move_info.actor:"未知"}}</view>
				<view class="text">{{move_info.year}}/{{move_info.district}}</view>
				<view class="bt">
					<view>
						<uni-icons type="undo"></uni-icons>
						<text>分享</text>
					</view>
					<view>
						<uni-icons type="pyq"></uni-icons>
						<text>海报</text>
					</view>
				</view>
			</view>
		</view>
		<!-- 播放 -->
		<view class="footer_box">
			<view style="display: flex;align-items: center;color: #f4d13a;">
				<text style="margin-right: 20rpx;">豆瓣:{{move_info.score}}</text>
				<uni-rate :touchable="false" :value="move_info.score" />
			</view>
			<view style="display: flex;align-content: center;" @click="toPlay">
				<image src="../../static/img/play.png" style="width: 50rpx;height: 50rpx;"></image>
				<text style="color: white;margin-left: 10rpx;font-size: 40rpx;font-weight: 600;">开始播放</text>
			</view>
		</view>
		<!-- 简介 -->
		<view>
			<view class="info">
				<uni-icons type="wallet" size="25"></uni-icons>
				<text>影片简介</text>
			</view>
			<view class="introduction">
				{{move_info.active_about}}
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				move_id: "",
				move_info: ""
			}
		},
		methods: {
			// 初始化数据
			async initData() {
				let res = await uniCloud.callFunction({
					name: "move_info",
					data: {
						_id: this.move_id
					}
				})
				console.log(res);
				this.move_info = res.result.data[0]
			},
			toPlay(){
				uni.navigateTo({
					url:`../play/play?id=${this.move_id}`
				})
			}
		},
		onLoad(option) {
			console.log(option);
			this.move_id = option.id
			this.initData()
		}
	}
</script>

<style scoped>
	.move_img {
		width: 220rpx;
		height: 350rpx;
	}

	.nav {
		display: flex;
	}

	.move_info {
		margin-left: 40rpx;
		line-height: 60rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
	}

	.name {
		font-weight: 600;
	}

	.text {
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.6);
	}

	.bt {
		display: flex;
	}

	.bt view {
		background-color: #f49c36;
		padding: 5rpx 30rpx;
		margin-right: 20rpx;
		border-radius: 20rpx;
	}

	.footer_box {
		background-color: #94a9bf;
		display: flex;
		justify-content: space-around;
		padding: 50rpx 0rpx;
		margin-top: 30rpx;
	}
	.info{
		font-size: 35rpx;
		font-weight: 600;
		display: flex;
		align-items: center;
		margin: 30rpx 0;
	}
	.info text{
		margin-left: 10rpx;
	}
	.introduction{
		font-size: 30rpx;
		color: rgba(0, 0, 0, 0.6);
	}
	
</style>
